namespace Infrastructure.Data.Uow.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddAutoPush : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "AutoPush",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remark = c.String(),
                        ContentId = c.Int(nullable: false),
                        AddTime = c.DateTime(nullable: false),
                        IpAddress = c.String(),
                        State = c.Boolean(nullable: false),
                        SortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "AutoPushDetail",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        AutoPushId = c.Int(),
                        TimerId = c.Int(nullable: false),
                        AddTime = c.DateTime(nullable: false),
                        IpAddress = c.String(),
                        State = c.Boolean(nullable: false),
                        SortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "AutoPushTimer",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        BeginTime = c.Int(nullable: false),
                        EndTime = c.Int(nullable: false),
                        AddTime = c.DateTime(nullable: false),
                        IpAddress = c.String(),
                        State = c.Boolean(nullable: false),
                        SortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            DropTable("PushSetting");
        }
        
        public override void Down()
        {
            CreateTable(
                "PushSetting",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Remark = c.String(),
                        BeginTime = c.DateTime(nullable: false),
                        EndTime = c.DateTime(nullable: false),
                        ContentId = c.Int(nullable: false),
                        IntervalTime = c.Int(nullable: false),
                        AddTime = c.DateTime(nullable: false),
                        IpAddress = c.String(),
                        State = c.Boolean(nullable: false),
                        SortNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            DropTable("AutoPushTimer");
            DropTable("AutoPushDetail");
            DropTable("AutoPush");
        }
    }
}
